package com.zhkc.iess.system.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Schema(description = "SysUserAddDTO")
public class SysUserAddDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = -4437839329952458054L;

    /**
     * 机构ID
     */
    @Schema(description = "机构ID")
    @NonNull
    private Long orgId;

    /**
     * 登录账号
     */
    @Schema(description = "登录账号")
    @NotBlank
    @Size(max = 20)
    private String account;

    /**
     * 用户昵称
     */
    @Schema(description = "用户昵称")
    @NotBlank
    @Size(max = 20)
    private String nickname;

    /**
     * 用户类型（1后台用户 2手机端用户）
     */
    @Schema(description = "用户类型（1后台用户 2手机端用户）")
    @NotBlank
    @Size(max = 1)
    private String userType;

    /**
     * 用户邮箱
     */
    @Schema(description = "用户邮箱")
    @Size(max = 50)
    private String email;

    /**
     * 手机号码
     */
    @Schema(description = "手机号码")
    @Pattern(regexp = "^[1][3-9][0-9]\\d{8}$")
    @Size(max = 20)
    private String phoneNumber;

    /**
     * 用户性别（1男 2女 3未知）
     */
    @Schema(description = "用户性别（1男 2女 3未知）")
    @Size(max = 1)
    private String sex;

    /**
     * 头像路径（存储图片的后缀路径）
     */
    @Schema(description = "头像路径（存储图片的后缀路径）")
    @Size(max = 100)
    private String avatar;

    /**
     * 密码
     */
    @Schema(description = "密码")
    @Pattern(regexp = "^(?=.[a-z])(?=.[A-Z])(?=.\\d)(?=.[@ @@!%?&])[A-Za-z\\d@ @@!%?&]{8,}")
    @NotBlank
    private String password;

    /**
     * 备注
     */
    @Schema(description = "备注")
    @Size(max = 200)
    private String remark;

}
